package com.feibiao.computer;
public class Div implements Operate {
    private double result;
    @Override
    public double compute(double operator1,double operator2) throws Exception {
        if (Math.abs(operator1) > 10e-6){
            result = operator2 / operator1;
        }else {
            throw new Exception("除数不能为0");//向上抛出异常
        }
        return result;
    }
    @Override
    public double compute(double operator) {
        return 0;
    }
}
